#!/usr/bin/make -f

GRAPH=output/graphs/graph_${N}_${M}_${S}
CLUSTERS=output/clusters/${PREFIX}_${N}_${M}_${S}_${K}
OUTPUT=output/analysis/${PREFIX}_${N}_${M}_${S}_${K}
METISDIR=~/Downloads/metis-4.0.3/

gen:
	./graph_gen.py ${N} ${M} 0.90 ${S} > ${GRAPH}

random:
	../tools/randomClusters.py  ${GRAPH} ${K} > ${CLUSTERS}
	./graph_analysis.py ${GRAPH} ${CLUSTERS} > ${OUTPUT}

kmetis:
	python ../preprocessing/convertGraph.py -i ${GRAPH} -f METIS -o /tmp/metis.graph.txt
	${METISDIR}kmetis /tmp/metis.graph.txt ${K} &> /tmp/metis.out
	../tools/metis2clusters.py /tmp/metis.graph.txt.part.${K}  > ${CLUSTERS}
	./graph_analysis.py ${GRAPH} ${CLUSTERS} > ${OUTPUT}

pmetis:
	python ../preprocessing/convertGraph.py -i ${GRAPH} -f METIS -o /tmp/metis.graph.txt
	${METISDIR}pmetis /tmp/metis.graph.txt ${K} &> /tmp/metis.out
	../tools/metis2clusters.py /tmp/metis.graph.txt.part.${K}  > ${CLUSTERS}
	./graph_analysis.py ${GRAPH} ${CLUSTERS} > ${OUTPUT}
